<?php
/**
 *	KLF Framework
 *
 *	Written by Kristian Oye <kristianoye@gmail.com> on Dec 18, 2011
 *	Copyright (C) 2010-2011
 */
namespace KLF\System\Web\MVC
{
	use KLF\System\KObject;

	/**
	 *  Class KActionContext
	 *
	 *  A context used within an action
	 *
	 *  @package KLF\System\Web\MVC
	 *  @access public
	 *  @author Kristian Oye <kristianoye@gmail.com>
	 *  @since 0.1
	 *
	 *  @method KActionContext NewInstance
	 *  
	 *  @property-read string $ActionName
	 *  @property-read string $ActionParameters
	 *  @property-read string $ActionResult
	 */
	class KActionContext extends KControllerContext
	{
		/**
		 * The action being invoked.
		 * 
		 * @var string $_rpropActionName
		 */
		protected $_rpropActionName;
		
		/**
		 * The parameters to be passed to the action.
		 * 
		 * @var array $_rpropActionParameters
		 */
		protected $_rpropActionParameters;
		
		/**
		 * The result of the action executing.
		 * 
		 * @var KActionResult $_propActionResult
		 */
		protected $_propActionResult;
		
		/**
		 * Construct an action context while executing an action.
		 * 
		 * @param KControllerContext $context
		 * @param string $actionName
		 * @param array $params
		 */
		public function __construct(KControllerContext $context, $actionName, $params = array())
		{
			parent::__construct($context->RouteContext, $context->Controller);
			
			$this->_propActionResult = null;
			$this->_rpropActionName = $actionName;
			$this->_rpropActionParameters = $params;
			$this->_rpropController = $context->Controller;
		}
	}
}